//tt-room-mods
var ttImagePath="http://bcj19-tt.googlecode.com/svn/trunk/images/";
if(!roomModsAlreadyExists) {
	if(!ttWallpaper)	{ var ttWallpaper = $('img[src*="/wallpaper.png"]'); } //get wallpaper src for area behind djs
	if(!ttWallpaper_orig) { if(ttWallpaper) { var ttWallpaper_orig = $(ttWallpaper).attr('src'); } } //remember default src

	if(!ttFloor) 		{ var ttFloor = $('img[src*="/floor.png"]'); } //get img src for floor
	if(!ttFloor_orig) 	{ if(ttFloor) { var ttFloor_orig = $(ttFloor).attr('src'); } }

	if(!ttDjTable)		{ var ttDjTable= $('img[src*="/dj_table.png"]'); } //ger img src for dj table
	if(!ttDjTable_orig) { if(ttDjTable) { var ttDjTable_orig = $(ttDjTable).attr('src'); } }

	/*
		setUpRoomMods() - selects custom images for wallpaper, floor and dj table
	*/
	function setUpRoomMods(pv_theme) {
		var wallpaperImage, floorImage, tableImage //define the variables for use below
		
		if(pv_theme) {
			var theTheme = [
				['poolballs', 'wallpaper_poolballs','floor_poolballs'], //theme name|wallpaper image|floor image|dj table image

				['analyticsgraph', 'wallpaper_analyticsGraph','','transparent_1x1'],
				['analyticsgraphChalk', 'wallpaper_analyticsGraph','floor_chalkOutline','transparent_1x1'],
				
				['neonstripe', 'wallpaper_neonStripe','','transparent_1x1'],
				['neonstripeChalk', 'wallpaper_neonStripe','floor_chalkOutline','transparent_1x1'],
				
				['tiki', 'wallpaper_tiki','','transparent_1x1'],
				['tikiChalk', 'wallpaper_tiki','floor_chalkOutline','transparent_1x1'],
				
				['beastie', 'beastie_ill'],
				['beastieChalk', 'beastie_ill','floor_chalkOutline'],
			];
			if(pv_theme=="random") {
				pv_theme = theTheme[Math.floor(Math.random() * theTheme.length)][0];
			}
			for ( i=0; i<theTheme.length; i++ ) {
				if(pv_theme==theTheme[i][0]) {
					(theTheme[i][1]) ? wallpaperImage=ttImagePath+theTheme[i][1]+'.png' : wallpaperImage=ttWallpaper_orig;
					(theTheme[i][2]) ? floorImage=ttImagePath+theTheme[i][2]+'.png' : floorImage=ttFloor_orig;
					(theTheme[i][3]) ? tableImage=ttImagePath+theTheme[i][3]+'.png' : tableImage=ttDjTable_orig;

					$(ttWallpaper).attr('src',wallpaperImage);
					$(ttFloor).attr('src',floorImage);
					$(ttDjTable).attr('src',tableImage);
				}
			}
		} else {
			setUpRoomMods("random");
		}
	}		
	setUpRoomMods(); //do it!
} else {
	var roomModsAlreadyExists=true; //prevent re-building functions/logic above
	
	setUpRoomMods(); //do it again!
}